<script>on closeField-- Requires handler: shareTheDatashareTheDataput false into bg field "Drew Data"pass closeFieldend closeFieldon exitField-- Requires handler: shareTheDatashareTheDatapass exitFieldend exitFieldon tabKeyput word 2 of the selectedLine into theLineif last char of bg field "Data" Γëá returnthen put return after bg field "Data"select after line theLine of bg field "Data"end tabKey</script>
</part>
<part>
<id>35</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <true /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>101</left>
<top>121</top>
<right>166</right>
<bottom>316</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>right</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>data</name>
<script>on closeField-- Requires handler: shareTheDatashareTheDataput false into bg field "Drew Data"pass closeFieldend closeFieldon exitField-- Requires handler: shareTheDatashareTheDatapass exitFieldend exitFieldon tabKeyput word 2 of the selectedLine into theLineif last char of bg field "Labels" Γëá returnthen put return after bg field "Labels"select after line theLine of bg field "Labels"end tabKey</script>
<script>on mouseDown-- Requires handler: doDragBtnset cursor to "Grab Hand"hide bg btn "GrowLegend"doDragBtn name of me,0,62,width of card window,height of card windowset botRight of bg btn "GrowLegend" to botRight of meshow bg btn "GrowLegend"end mouseDownon mouseup-- Requires handler: drawChartdrawChartend mouseup</script>
</part>
<part>
<id>51</id>
<type>button</type>
<visible> <false /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>495</left>
<top>322</top>
<right>511</right>
<bottom>338</bottom>
</rect>
<style>rectangle</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>15467</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>growLegend</name>
<script>on mouseDown-- Requires function handlers: validatedData,maxCharsset cursor to arrowset icon of me to "Inverse Grow Box"set style of me to rectangleset style of bg btn "Legend" to "rectangle"put the rect of bg btn "Legend" into frameRectput width of me div 2 into halfMyWidthput height of me div 2 into halfMyHeightput number of lines of validatedData(bg field "Data") into dataCountput maxChars(stripReturns(bg field "Labels")) * 8 into maxLabelSizeput maxLabelSize + 70 into maxWidthput (dataCount * 17) + 20 into maxHeightput width of card window into cardWidthput height of card window into cardHeightrepeat until the mouse is upput the mouseLoc into newLocif item 1 of newLoc <= (item 1 of frameRect + maxWidth)then put item 1 of frameRect + (maxWidth - halfMyWidth) ¬into item 1 of newLocput min(item 1 of newLoc,cardWidth - halfMyWidth) ¬into item 1 of newLocif item 2 of newLoc <= (item 2 of frameRect + maxHeight)then put item 2 of frameRect + (maxHeight - halfMyHeight) ¬into item 2 of newLocput min(item 2 of newLoc,cardHeight - halfMyHeight) ¬into item 2 of newLocset loc of me to newLocput bottom of me into item 4 of frameRect -- new bottomput right of me into item 3 of frameRect -- new rightset rect of bg btn "Legend" to frameRectend repeatset icon of me to "Grow Box"set style of me to rectangleend mouseDownon mouseup-- Requires handlers: drawChartdrawChartend mouseup</script>
</part>
<part>
<id>46</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>0</left>
<top>62</top>
<right>509</right>
<bottom>339</bottom>
</rect>
<style>rectangle</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<name>frame</name>
<script>on mouseDown-- Requires handler: doDragBtnset cursor to "Grab Hand"doDragBtn name of me,0,62,width of card window,height of card windowset botRight of bg btn "Grow" to botRight of meshow bg btn "Grow"end mouseDownon mouseUp-- Requires handler: saveRect,drawChartsaveRectdrawChartend mouseUp</script>
<script>∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞Script of stack: Graph MakerTHE MESSAGE HANDLERS IN THIS SCRIPT:openCard,closeCard,openField,closeField,exitField,enterInField,enterKeydoDragBtn,resetDrawFlag,shareTheData,showInfo,clearScreen,setFontsaveRect,checkUserCancelTHE FUNCTION HANDLERS IN THIS SCRIPT:stripReturns,validatedData,roundUp,rectWidth,rectHeightgetMaxValue,maxChars∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞on SETCardglobal IsCommonData,theData,theLabels,theTitle,theDataTitle,theUnitsget bg field "Graph Rect"set rect of bg btn "Frame" to line 1 of itset rect of bg btn "Grow" to line 2 of itunlock screen-- if IsCommonData then-- put theData into bg field "Data"-- put theLabels into bg field "Labels"put theDataTitle into bg field "Labels Title"put theTitle into bg field "Graph Title"put theUnits into bg field "Units"-- end ifif not bg field "Drew Data" thensend "drawChart" to this cardput true into bg field "Drew Data"end ifpass openCardend SETCardon closeCard-- Requires handlers: saveRect,showInfosaveRect -- saves current frame sizeshowInfo falselock screenpass closeCardend closeCardon enterInFieldclick at the loc of bg btn "Drawgraph"end enterInFieldon enterKeyclick at the loc of bg btn "Drawgraph"end enterKey----- Misc ----------------------------------------------------on doDragBtn btnID,left,top,right,bottom-- drag a button within the card areaput (the clickH - item 1 of the loc of btnID) into horzStartput (the clickV - item 2 of the loc of btnID) into vertStartput width of btnID div 2 into horzOffsetput height of btnID div 2 into vertOffsetput horzOffset + left into cardLeftput vertOffset + top into cardTopput right - horzOffset into cardRightput bottom - vertOffset into cardBottomrepeat until the mouse is upput max(the mouseH - horzStart,cardLeft) into horzput min(horz,cardRight) into item 1 of newLocput max(the mouseV - vertStart,cardTop) into vertput min(vert,cardBottom) into item 2 of newLocset loc of btnID to newLocend repeatend doDragBtnon resetDrawFlagput "11352,13427,12850,14091" into cardIdNumsput value(the target) into theDatarepeat with count = 1 to 4-- put false into bg field "Drew Data" of card id (item count of cardIDNums)end repeatend resetDrawFlagon shareTheData-- Requires handler: resetDrawFlagglobal IsCommonData,theData,theLabels,theTitle,theDataTitle,theUnits-- if IsCommonData thenresetDrawFlagput bg field "Data" into theDataput bg field "Labels" into theLabelsput bg field "Labels Title" into theDataTitleput bg field "Graph Title" into theTitleput bg field "Units" into theUnits-- else put false into bg field "Drew Data"end shareTheDataon showInfo showHideset visible of bg field "Graph Info" to showHideend showInfo----- Utilities -----------------------------------------------on clearScreen-- removes the paint from the card layerchoose "Select Tool"doMenu "Select All"doMenu "Clear Picture"end clearScreenon setFont fontName,fontSize,fontAlignment,fontStyleif fontName is not empty then set textFont to fontNameif fontSize is not empty then set textSize to fontSizeif fontSize is not empty then set textheight to fontSizeif fontAlignment is not empty then set textAlign to fontAlignmentif fontStyle is not empty then set textStyle to fontStyleend setFonton saveRect-- "Graph Rect" is a hidden fieldput rect of bg btn "Frame" into line 1 of bg field "Graph Rect"put rect of bg btn "Grow" into line 2 of bg field "Graph Rect"end saveRecton checkUserCancelif the mouseClick thenchoose browse toolexit to hyperCardend ifend checkUserCancelfunction stripReturns theText -- remove all trailing return charsrepeat until last char of theText ≠ returndelete last char of theTextend repeatreturn theTextend stripReturns----- Data Functions -----------------------------------------------function validatedData data,labelsput max(number of lines in data,number of lines in labels) into numDatarepeat with count = 1 to numDataif ((line count of data is not a number) or ¬(line count of data < 0) or (line count of data is empty))then put zero into line count of dataend repeatreturn dataend validatedDatafunction roundUp anyNumber-- rounds a number to the nearest value divisible by 10,100,1000, etcput trunc(anyNumber) into wholeNumberput (10^(length(wholeNumber) - 1)) into divisorif wholeNumber mod divisor = 0 then return wholeNumberelse return (trunc((wholeNumber/divisor) + 1)) * divisorend roundUpfunction rectWidth theRect-- returns the width of a rectanglereturn item 3 of theRect - item 1 of theRectend rectWidthfunction rectHeight theRect-- returns the height of a rectanglereturn item 4 of theRect - item 2 of theRectend rectHeightfunction getMaxValue dataList-- returns the number with the highest valuesort dataList descending numericreturn line 1 of dataListend getMaxValuefunction maxChars textList-- determines the longest word of a listput 0 into longestrepeat with theLine = 1 to the number of lines in textListif length(line theLine of textList) > longestthen put length(line theLine of textList) into longestend repeatreturn longestend maxChars</script>